<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>DHTML Tree samples. dhtmlXTree - Custom Drag Out</title>
</head>
<style>
	body {font-size:12px}
	.{font-family:arial;font-size:12px}
	h1 {cursor:hand;font-size:16px;margin-left:10px;line-height:10px}
	xmp {color:green;font-size:12px;margin:0px;font-family:courier;background-color:#e6e6fa;padding:2px}
</style>
<body>
	<h1>Custom Drag Out</h1>
	<link rel="STYLESHEET" type="text/css" href="../css/dhtmlXTree.css">
	<script  src="../js/dhtmlXCommon.js"></script>
	<script  src="../js/dhtmlXTree.js"></script>
Drag node from tree to input control      		
	<table>
		<tr>
			<td>
				<div id="treeboxbox_tree" style="width:250; height:218;background-color:#f5f5f5;border :1px solid Silver;; overflow:auto;"/>
			</td>
			<td style="padding-left:25" valign="top">
				<input type="text" width="120px" id="sInput">
			</td>
		</tr>
		<tr>
			<td></td>
		</tr>
	</table>
<hr>
	<script>
        function maf(){
            return false;
        }

			tree=new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);
			tree.setImagePath("../imgs/");
			tree.enableDragAndDrop(true);
            tree.setDragHandler(maf);
			tree.enableSmartXMLParsing(true);
			tree.loadXML("tree.xml")
			
			//
			function s_control(){
			
			this._drag=function(sourceHtmlObject,dhtmlObject,targetHtmlObject){
				targetHtmlObject.style.backgroundColor="";
				targetHtmlObject.value=sourceHtmlObject.parentObject.label;
			}

			this._dragIn=function(htmlObject,shtmlObject){
				htmlObject.style.backgroundColor="#fffacd";
				return htmlObject;
			}

			this._dragOut=function(htmlObject){
				htmlObject.style.backgroundColor="";
				return this;
			}
			
			}
			var sinput=document.getElementById('sInput');
			tree.dragger.addDragLanding(sinput, new s_control);
			
	</script>
<br><br>

</body>
</html>
